<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

	<ui:composition 
	  xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      template="/templates/templateLayout.xhtml">
      
      <ui:define name="conteudo">   
      <link rel="stylesheet" type="text/css" href="./estilos.css"/>   	
  	
<h:form id="formConsultarLog" prependId="false">  
 	 	<p:commandButton value="Projeto" action="#{projetoBean.viewProjeto}" immediate="true" />
 	<p:commandButton value="Atividade" action="#{atividadeBean.consultarAtividade}" immediate="true"/>
 	<p:commandButton value="Milestone" action="#{milestoneBean.consultarMilestone}" immediate="true"/> 
 	<p:commandButton value="Membro" action="#{projetoBean.membroProjeto}" immediate="true"/>
 	<p:commandButton value="Log" action="#{projetoBean.consultarLog}" immediate="true"/>
	<p:panel id="idPanelConsultarLog" style="margin-bottom:20px; ">  
		<f:facet name="header">
			<h:outputText value="Consultar Logs do Projeto: #{projetoBean.projeto.nomeProjeto}" styleClass="outputTextTitulo" />
		</f:facet>
 	<p:growl id="growl" showDetail="true"/> 
    	<h:panelGrid id="idPanelGridLog" columns="4" >  
            <h:outputLabel value="Código do Usuário: " styleClass="outputLabel"/>  
            <p:inputText value="#{projetoBean.usuarioLog.idUsuario}" styleClass="inputId"/>  
  
            <p:outputLabel value="Usuário:" styleClass="outputLabel"/>  
            <p:inputText value="#{projetoBean.usuarioLog.nome}" styleClass="inputDescricao"/>  
            
            <h:outputLabel value="Data de início:" styleClass="outputLabel"/>  
            <p:inputMask value="#{projetoBean.dtInicialLog}" mask="99/99/9999" styleClass="inputData">
            	<f:convertDateTime dateStyle="medium"/>
            </p:inputMask>  
  
			<h:outputLabel value="Data final:" styleClass="outputLabel"/>  
            <p:inputMask value="#{projetoBean.dtFinalLog}" mask="99/99/9999" styleClass="inputData">
            	<f:convertDateTime dateStyle="medium"/>
            </p:inputMask>  
        </h:panelGrid>  
    </p:panel>  
    <p:commandButton value="Consultar" action="#{projetoBean.findLog}" update="dataTableLog" style="margin-right:20px; margin-left:10px;" /> 
   		
    <p:dataTable id="dataTableLog" var="log" value="#{projetoBean.listaLog}" 
    			 rowKey="#{log.idLog}" selectionMode="single" style="padding-top:20px; width:60%; height:450px; overflow:auto">  
        <f:facet name="header">Lista de Logs</f:facet>  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Usuário" />  
            </f:facet>  
            <h:outputText value="#{log.usuario.nome}" />  
        </p:column>  
        
         <p:column>  
            <f:facet name="header">  
                <h:outputText value="Data/hora" />  
            </f:facet>  
            <h:outputText value="#{log.data}" >
            	<f:convertDateTime dateStyle="full"/>
            </h:outputText>  
        </p:column>  
  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Descrição" />  
            </f:facet>  
            <h:outputText value="#{log.descricao}" />  
        </p:column>  
    </p:dataTable>   
    
     
</h:form>  	
</ui:define>
</ui:composition>
